/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.yuecai.modules.yc_receiver_info.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author dm
* @date 2020-06-26
**/
@Entity
@Data
@Table(name="yc_receiver_info")
public class YcReceiverInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "user_id",nullable = false)
    @NotNull
    @ApiModelProperty(value = "用户id")
    private Long userId;

    @Column(name = "city_code")
    @ApiModelProperty(value = "市code")
    private String cityCode;

    @Column(name = "province_code")
    @ApiModelProperty(value = "省code")
    private String provinceCode;

    @Column(name = "county_code")
    @ApiModelProperty(value = "区县code")
    private String countyCode;

    @Column(name = "address")
    @ApiModelProperty(value = "地址")
    private String address;

    @Column(name = "receiver")
    @ApiModelProperty(value = "收货人姓名")
    private String receiver;

    @Column(name = "phone_num")
    @ApiModelProperty(value = "收货人手机号")
    private String phoneNum;

    @Column(name = "post_code")
    @ApiModelProperty(value = "邮编")
    private String postCode;


    @Column(name = "store")
    @ApiModelProperty(value = "店铺")
    private String store;

    @Column(name = "default_sign")
    @ApiModelProperty(value = "地址的条目是否默认标识，0不是，1是")
    private Boolean defaultSign;



    @Column(name = "longitude")
    @ApiModelProperty(value = "经度")
    private String longitude;

    @Column(name = "latitude")
    @ApiModelProperty(value = "纬度")
    private String latitude;


    @Column(name = "create_time",nullable = false)
    @ApiModelProperty(value = "时间")
    private Timestamp createTime;



    public void copy(YcReceiverInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}